import java.util.List;

public class Tree {
    public static void main(String[] args) {
        BinaryTree binaryTree=new BinaryTree();
        binaryTree.createTree();
        System.out.println("前序遍历:");
        binaryTree.preOrder(binaryTree.root);
        System.out.println("==========");
        System.out.println("中序遍历:");
        binaryTree.inOrder(binaryTree.root);
        System.out.println("==========");
        System.out.println("后序遍历:");
        binaryTree.postOrde(binaryTree.root);
        System.out.println("节点个数为(遍历思路)"+binaryTree.size(binaryTree.root));
        System.out.println("节点个数为(子问题思路)"+binaryTree.size2(binaryTree.root));

        System.out.println("叶子节点个数为(遍历思路)"+binaryTree.getLeafNodeCount(binaryTree.root));
        System.out.println("叶子节点个数为(子问题思路)"+binaryTree.getLeafNodeCount2(binaryTree.root));
        System.out.println("第k层节点的个数"+binaryTree.getKLevelNodeCount(binaryTree.root,3));
        System.out.println("树的高度"+binaryTree.getHeight(binaryTree.root));
        System.out.println("寻找D节点:"+binaryTree.find(binaryTree.root,'D').val);
        binaryTree.levelOrder(binaryTree.root);
        List<List<Character>> list=binaryTree.levelOrder2(binaryTree.root);
        System.out.println("层序遍历"+list);
        System.out.println("是否为完全二叉树"+binaryTree.isCompleteTree(binaryTree.root));
    }

}
